﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DungeonCraft.DataModel.Abilities.Interfaces;

namespace DungeonCraft.DataModel.Abilities.Guards
{
    public class ManaGuard : IGuard
    {

        public bool Check(DataModel.Interfaces.ILevel level, Player player, IAbility ability)
        {
            if (!player.canUseAbility())
                return false;
            if(!(ability is AManaUsingAbility))
                return false;
            AManaUsingAbility mAbility = (AManaUsingAbility)ability;
            if (player.Mana < mAbility.Mana)
                return false;
            return true;
        }
    }
}
